API Documentation
Static Public Member Functions | List of all members
nkGraphics::TextureUtils Class Referencefinal

Utility class to retrieve or compute interesting data about textures. More...

Static Public Member Functions

static void computeIrradianceSH (Texture *input, Texture *output)
 
static unsigned int getFormatByteSize (FORMAT format)
 
static unsigned int getFormatChannelCount (FORMAT format)
 
static FORMAT getFormatSrgbEquivalent (FORMAT format)
 
static FORMAT getFormatRgbEquivalent (FORMAT format)
 
static FORMAT getFormatTypelessEquivalent (FORMAT format)
 
static FORMAT getFormatDepthEquivalent (FORMAT format)
 
static bool isFormatOver255 (FORMAT format)
 
static bool isFormatCompressed (FORMAT format)
 
static bool isFormatCompatibleForRenderFlag (FORMAT format, TEX_RENDER_FLAG renderFlag)
 
static int getNeededMipsForSize (int width, int height, int depthOrArraySize)
 

Detailed Description

Utility class to retrieve or compute interesting data about textures.

Member Function Documentation

◆ computeIrradianceSH()

static void nkGraphics::TextureUtils::computeIrradianceSH ( Texture input,
Texture output 
)
static

Computes the irradiance map of a texture, using spherical harmonics. For now, only supports 2D textures. Cubemaps are not supported.

Parameters
inputThe texture from which to compute the irradiance map.
outputThe texture that will receive the irradiance computed.

◆ getFormatByteSize()

static unsigned int nkGraphics::TextureUtils::getFormatByteSize ( FORMAT  format)
static
Parameters
formatThe format to use.
Returns
The size, in bytes, of one element of the format passed.

◆ getFormatChannelCount()

static unsigned int nkGraphics::TextureUtils::getFormatChannelCount ( FORMAT  format)
static
Parameters
formatThe format to use.
Returns
The number of channels (r, g, b, a) used by the format passed.

◆ getFormatSrgbEquivalent()

static FORMAT nkGraphics::TextureUtils::getFormatSrgbEquivalent ( FORMAT  format)
static
Parameters
formatThe format to use.
Returns
The srgb equivalent format of the format passed, if available. The format passed if unavailable.

◆ getFormatRgbEquivalent()

static FORMAT nkGraphics::TextureUtils::getFormatRgbEquivalent ( FORMAT  format)
static
Parameters
formatThe format to use.
Returns
The rgb equivalent format of the format passed, if available. The format passed if unavailable.

◆ getFormatTypelessEquivalent()

static FORMAT nkGraphics::TextureUtils::getFormatTypelessEquivalent ( FORMAT  format)
static
Parameters
formatThe format to use.
Returns
The typeless equivalent format of the format passed, if available. The format passed if unavailable.

◆ getFormatDepthEquivalent()

static FORMAT nkGraphics::TextureUtils::getFormatDepthEquivalent ( FORMAT  format)
static
Parameters
formatThe format to use.
Returns
The depth equivalent format of the format passed, if available. The format passed if unavailable.

◆ isFormatOver255()

static bool nkGraphics::TextureUtils::isFormatOver255 ( FORMAT  format)
static
Parameters
formatThe format to use.
Returns
If the format values should be considered in [0, 255] (true) or, rather, between [0.0, 1.0] (false).

◆ isFormatCompressed()

static bool nkGraphics::TextureUtils::isFormatCompressed ( FORMAT  format)
static

Checks whether a format is compressed. Compressed formats are usually variants of BC and such.

Parameters
formatThe format to use.
Returns
If the format is compressed (true) or not (false).

◆ isFormatCompatibleForRenderFlag()

static bool nkGraphics::TextureUtils::isFormatCompatibleForRenderFlag ( FORMAT  format,
TEX_RENDER_FLAG  renderFlag 
)
static
Parameters
formatThe format to use.
renderFlagThe render flag to check against.
Returns
If the format is compatible to use with given render flag.

◆ getNeededMipsForSize()

static int nkGraphics::TextureUtils::getNeededMipsForSize ( int  width,
int  height,
int  depthOrArraySize 
)
static
Parameters
widthThe width of the texture.
heightThe height of the texture.
depthOrArraySizeThe depth, or array size, of the texture.
Returns
The number of mips needed to generate a full mip chain for the dimensions given.

The documentation for this class was generated from the following file: